<template>
  <wd-config-provider 
    class="provider-wrap"
    :theme="themeConfig.theme" 
    :themeVars="themeVars[themeConfig.theme]"
  >
    <view 
      style="display: flex;flex-direction: column;height: 100vh;" 
      v-if="!hideBarList.includes(themeConfig.title) || themeConfig.isChat"
    >
      <!--  #ifdef MP-WEIXIN -->
      <wd-navbar 
        placeholder 
        safeAreaInsetTop 
        :title="themeConfig.title" 
        left-arrow 
        @click-left="back"
      ></wd-navbar>
      <!--  #endif -->
      <view style="flex: 1;overflow: scroll;position: relative;">
        <slot />
      </view>
    </view>
    
    <template v-else>
      <slot />
    </template>
    <wd-toast custom-class="toast-com-wrap" />
    <wd-message-box />
  </wd-config-provider>
</template>

<script lang="ts" setup>
import PLATFORM from '@/utils/platform';
import { useThemeStore } from '@/store';
import { back } from '@/utils';

const { themeConfig, themeVars } = useThemeStore();
const hideBarList = ref([
  '悬赏征婚', '我喜欢的', '我收藏的', '我联系过的', '聊天室',
  '联系过我的', '查看过我的', 'chat', '用户详情', '毕业院校', '约会',
]);

const platform = computed(() => {
  return PLATFORM.platform
})
</script>

